/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gproyect2.service;

import com.gproyect2.model.User;
import java.io.Serializable;
import java.util.List;

/**
 *
 * @author Administrador
 */
public class UserService extends GenericService<User, Long> {

    public User getUser(String userId) {
        return this.get(new Long(userId));
    }

    /**
     * {@inheritDoc}
     */
    public List<User> getUsers() {
        return this.getAll();
    }

    /**
     * {@inheritDoc}
     */
    public User saveUser(User user) throws UserExistsException {

        if (user.getVersion() == null) {
            // if new user, lowercase userId
            user.setUsername(user.getUsername().toLowerCase());
        }

        return this.save(user);

    }


    @Override
    public User save() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public User get(long id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<User> getAll() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean remove(User object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean update(User object) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
